/**
 * ...
 * @author Krzysztof Rozalski
 */

package test;
import hapi.math.MathUtil;
import hapi.unit.HapiTestCase;

class TestMathUtil extends HapiTestCase {

	public function testMinimizeAngle() {
		var a = MathUtil.minimaizeAngle(MathUtil.degToRad(400));
		assertFloatEqualsWithTolerance(40.0, MathUtil.radToDeg(a));
		
		var b = MathUtil.minimaizeAngle(MathUtil.degToRad(370));
		assertFloatEqualsWithTolerance(10.0, MathUtil.radToDeg(b));
	}
	
	public function testWrapPI() {
		var a = MathUtil.wrapPI(MathUtil.degToRad(400));
		assertFloatEqualsWithTolerance(40.0, MathUtil.radToDeg(a));
	}
}